package com.yunc.modules.sys.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yunc.base.SuperMapper;
import com.yunc.common.utils.ZTreeNode;
import com.yunc.modules.sys.entity.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author taocongcong
 * @create 2017-12-15 13:42
 */
@Mapper
public interface SysUserMapper extends SuperMapper<SysUser> {

    /**
     * 根据登录用户id查询权限获取menu
     */
    List<String> queryMenuIdByUserId(@Param("userId") Long userId);

    /**
     * 根据登录用户id查询权限并获取的menu的权限字段
     */
    List<String> queryUserMenuPermsList(@Param("userId") Long userId);

    List<String> queryMenuIdByRoleId(@Param("roleId") Long roleId);

    IPage<SysUser> pageInfo(Page<SysUser> page, @Param("userName")String userName, @Param("deptCode")String deptCode);

    /**
     * 查询组织人员树
     */
    List<ZTreeNode> listDeptUserTree();
}
